// 本颜色有color.scss进行转化而来
// export const __primary_color = "#dd5058";
// export const __insert_button_color = "#dd5058";
// export const __search_button_color = "#db7177";
// export const __refresh_button_color = "#e99d42";
// export const __main_scene_header_color = "#32333b";

/*
替换方式
\$(.*#.*); 替换为[$1]

*/
import { ref } from "vue";
export const colorMap = new Map([
  // 废弃
  ["__primary_color", "#dd5058"],
  ["__insert_button_color", "#dd5058"],
  ["__search_button_color", "#db7177"],
  ["__refresh_button_color", "#e99d42"],
  ["__main_scene_header_color", "#32333b"],
  ["__secondary_color", "#db7177"],
  ["__login_button_color", "#db7177"],
]);

const colorObject = ref({
  __primary_color: "#0ee27f",
  __insert_button_color: "#1fe7ab",
  __search_button_color: "#31c487",
  __refresh_button_color: "#93e942",
  __main_scene_header_color: "#32333b",
  __secondary_color: "#62f07a",
  __login_button_color: "#11e9d7",
  __accept_button_color: "#01f080",
  __reject_button_color: "#ff7878",
});

// 未知的原因，vite.config.js中的define无法将对象的方法一起包含
/**
 * 动态颜色字符串管理
 */
export const colorManager = {
  getColor: (key) => {
    return colorObject.value[key];
  },
  getColorMap: () => {
    return colorMap;
  },
};
